home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / ddjgrep.zip / README < prev    next >
Text File  |  1987-11-04  |  3KB  |  60 lines

  1. The grep routines were from the October 1984 Dr. Dobbs.
  2. It has five parts (1) tools.h (2) tools.c (3) grep.c (4) bitmap.c (5) queue.c.
  3. I put in the update from the June 1985 Dr.Dobbs that utilized the bitmaps and 
  4. queue routines.
  5.  
  6. Since I hand entered these routines I did not put in the comments; If you are
  7. interested look up a back issue. It was compiled under MSC 4.0, with modified
  8. startup routines to use wild card expansion from the command line, and double 
  9. quote mechanism. The routines have been modified slightly I took out the 
  10. references to CPM in the different files.
  11.  
  12. In other words if you say        grep "this is one arg" filename 
  13. there are three arguements. 
  14. To pass quotes in the pattern use a backslash and quote,
  15.                                  grep "\"this puts a quote in the pattern\""
  16.  
  17. Hope this is not too unclear.
  18.  
  19. The flags are:
  20.         -v      all lines but thos matching are printed
  21.         -c      only a count of the matching lines are printed
  22.         -l      the name of the files withe matching lines are listed (once)
  23.                   seperated by newlines.
  24.         -n      each line is preceded by its line number in the file
  25.         -h      do not print filename headers with output lines
  26.         -y      all characters in the file are mapped to upper case before
  27.                   matching
  28.         -e      <expression> same as a simple expression, useful if the 
  29.                   expression begins with a '-'
  30.         -f      <file> the regular expression is taken from the file. If 
  31.                   several regular expressions are listed (seperated by 
  32.                   newlines or  | 's) then a match will be flagged if any of 
  33.                   the regular expressions are satisfied. 
  34.                  -e and -f are mutually exclusive, if -f is given, any regular
  35.                  expression on the command line is toaken to be a filename.
  36.  
  37.  
  38.  
  39.         example: grep -n "^[a-z][a-z]*[\s\t]*.*([^;]*)[^;]*$" <file list>
  40.                   this creates a cross reference of a C program, file list
  41.                   to be replaced by name name name  or name.* or some such
  42.                   combination. If the pattern is in a file '-f' don' use the
  43.                   surrounding double quotes.
  44.  
  45.     example: grep -n "TRUE|FALSE|MAYBE" <file list>
  46.         this looks for the pattern TRUE or FALSE or MAYBE at the same
  47.         time.
  48.  
  49. All features of the unix version of grep are supported except the -s, -x and 
  50.  -b options and the metacharacters (,),+ and ?.
  51.  
  52. This was done when version 7 was the prevelant version of unix.
  53.  
  54. If you dont want to use this as grep the routines may be useful in their own
  55. right in an editor or whatever way that you want to use them.
  56.  
  57. Have Fun 
  58.  
  59. Don
  60.